<?php

namespace App\Models;

use Eloquent as Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * Class NewDevelopment
 * @package App\Models
 * @version February 25, 2018, 1:53 pm UTC
 *
 * @property string title
 * @property string author
 * @property string pic
 * @property integer read_num
 * @property integer like_num
 * @property string content
 */
class NewDevelopment extends Model
{
    use SoftDeletes;

    public $table = 'new_developments';
    

    protected $dates = ['deleted_at'];


    public $fillable = [
        'new_development_type_id',
        'title',
        'author',
        'pic',
        'read_num',
        'like_num',
        'content'
    ];

    /**
     * The attributes that should be casted to native types.
     *
     * @var array
     */
    protected $casts = [
        'title' => 'string',
        'author' => 'string',
        'pic' => 'string',
        'read_num' => 'integer',
        'like_num' => 'integer',
        'content' => 'string'
    ];

    /**
     * Validation rules
     *
     * @var array
     */
    public static $rules = [
        
    ];

    public function cate()
    {
        return $this->belongsTo('App\Models\NewDevelopmentType','new_development_type_id');
    }
}
